﻿using System;
using Xtensive.Orm;

namespace ClusteredSecondaryIndex.Model
{
    /*
     * To change the index is used for table clustering, use [Index("field name", Clustered = true)] construct
     */
    [HierarchyRoot]
    [Index("Isbn", Clustered = true, Unique = true, Name = "IX_ISBN")]
    public class Book : Entity
    {
        [Field, Key]
        public Guid Id { get; set; }

        [Field]
        public string Title { get; set; }

        [Field]
        public string Isbn { get; set; }

        public Book(Session session) :
            base(session) {}
    }
}